package com.css.zfzx.sjcj.modules.yhdisasiterschedule.controller;

import com.css.bpm.platform.constants.PlatformConstants;
import com.css.zfzx.sjcj.common.RestResultData;
import com.css.zfzx.sjcj.modules.jobschedule.entity.vo.QueryRespondVO;
import com.css.zfzx.sjcj.modules.statistics.yhDisaster.service.YhDisasterService;
import com.css.zfzx.sjcj.modules.yhdisasiterschedule.service.YhScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Description: pc-statistics
 * @Author: lhl
 * @CreateDate: 2021/8/31 11:28
 */
@RestController
@RequestMapping("/pc/yhSchedule")
public class YhScheduleController {
    @Autowired
    YhScheduleService yhScheduleService;

    ///pc/yhSchedule/find1
    @GetMapping("/find1")
    public RestResultData<List<QueryRespondVO>> pcFindData1(HttpServletRequest req) {
        String usersId = (String) req.getSession().getAttribute(PlatformConstants.CUR_USER_ID_IN_SESSION);
        List<QueryRespondVO> pcSchedule = yhScheduleService.findPcSchedule1(usersId);
        return RestResultData.ok(pcSchedule);
    }
    ///pc/yhSchedule/find2
    @GetMapping("/find2")
    public RestResultData<List<QueryRespondVO>> pcFindData2(HttpServletRequest req) {
        String usersId = (String) req.getSession().getAttribute(PlatformConstants.CUR_USER_ID_IN_SESSION);
        List<QueryRespondVO> pcSchedule = yhScheduleService.findPcSchedule2(usersId);
        return RestResultData.ok(pcSchedule);
    }
    ///pc/yhSchedule/find3
    @GetMapping("/find3")
    public RestResultData<List<QueryRespondVO>> pcFindData3(HttpServletRequest req) {
        String usersId = (String) req.getSession().getAttribute(PlatformConstants.CUR_USER_ID_IN_SESSION);
        List<QueryRespondVO> pcSchedule = yhScheduleService.findPcSchedule3(usersId);
        return RestResultData.ok(pcSchedule);
    }
    ///pc/yhSchedule/find4
    @GetMapping("/find4")
    public RestResultData<List<QueryRespondVO>> pcFindData4(HttpServletRequest req) {
        String usersId = (String) req.getSession().getAttribute(PlatformConstants.CUR_USER_ID_IN_SESSION);
        List<QueryRespondVO> pcSchedule = yhScheduleService.findPcSchedule4(usersId);
        return RestResultData.ok(pcSchedule);
    }

    ///pc/yhSchedule/export1
    @GetMapping("/export1")
    public void pcExportData1(HttpServletRequest req, HttpServletResponse resp) {
        String usersId = (String) req.getSession().getAttribute(PlatformConstants.CUR_USER_ID_IN_SESSION);
        yhScheduleService.exportPcSchedule1(usersId,resp);
    }
    ///pc/yhSchedule/export2
    @GetMapping("/export2")
    public void pcExportData2(HttpServletRequest req, HttpServletResponse resp) {
        String usersId = (String) req.getSession().getAttribute(PlatformConstants.CUR_USER_ID_IN_SESSION);
        yhScheduleService.exportPcSchedule2(usersId,resp);
    }
    ///pc/yhSchedule/export3
    @GetMapping("/export3")
    public void pcExportData3(HttpServletRequest req, HttpServletResponse resp) {
        String usersId = (String) req.getSession().getAttribute(PlatformConstants.CUR_USER_ID_IN_SESSION);
        yhScheduleService.exportPcSchedule3(usersId,resp);
    }
    ///pc/yhSchedule/export4
    @GetMapping("/export4")
    public void pcExportData4(HttpServletRequest req, HttpServletResponse resp) {
        String usersId = (String) req.getSession().getAttribute(PlatformConstants.CUR_USER_ID_IN_SESSION);
        yhScheduleService.exportPcSchedule4(usersId,resp);
    }
}
